<?php

/***************************************************************
*  Copyright notice
*
*  (c) 2010 Samuel Scherer <trashcash@gmail.com>, plan-T
*  			
*  All rights reserved
*
*  This script is part of the TYPO3 project. The TYPO3 project is
*  free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

/**
 * Controller for the eventProgram object
 *
 * @version $Id$
 * @copyright Copyright belongs to the respective authors
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
 */

// TODO: As your extension matures, you should use Tx_Extbase_MVC_Controller_ActionController as base class, instead of the ScaffoldingController used below.
class Tx_T3dance_Controller_eventProgramController extends Tx_Extbase_MVC_Controller_ActionController {
	
	/**
	 * @var Tx_T3dance_Domain_Repository_eventProgramRepository
	 */
	protected $eventProgramRepository;

	/**
	 * Initializes the current action
	 *
	 * @return void
	 */
	protected function initializeAction() {
		$this->eventProgramRepository = t3lib_div::makeInstance('Tx_T3dance_Domain_Repository_eventProgramRepository');
	}
	/**
	 * List action for this controller. Displays all eventPrograms.
	 */
	public function indexAction() {
		$eventPrograms = $this->eventProgramRepository->findAll();
		$this->view->assign('eventPrograms', $eventPrograms);
	}

	/**
	 * Action that displays a single eventProgram
	 *
	 * @param Tx_T3dance_Domain_Model_eventProgram $eventProgram The eventProgram to display
	 */
	public function showAction(Tx_T3dance_Domain_Model_eventProgram $eventProgram) {
		$this->view->assign('eventProgram', $eventProgram);
	}

	/**
	 * Displays a form for creating a new eventProgram
	 *
	 * @param Tx_T3dance_Domain_Model_eventProgram $neweventProgram A fresh eventProgram object taken as a basis for the rendering
	 * @dontvalidate $neweventProgram
	 */
	public function newAction(Tx_T3dance_Domain_Model_eventProgram $neweventProgram = NULL) {
		$this->view->assign('neweventProgram', $neweventProgram);
	}

	/**
	 * Creates a new eventProgram and forwards to the index action.
	 *
	 * @param Tx_T3dance_Domain_Model_eventProgram $neweventProgram A fresh eventProgram object which has not yet been added to the repository
	 */
	public function createAction(Tx_T3dance_Domain_Model_eventProgram $neweventProgram) {
		$this->eventProgramRepository->add($neweventProgram);
		$this->flashMessageContainer->add('Your new eventProgram was created.');
		$this->redirect('index');
	}

	/**
	 * Displays a form to edit an existing eventProgram
	 *
	 * @param Tx_T3dance_Domain_Model_eventProgram $eventProgram The eventProgram to display
	 * @dontvalidate $eventProgram
	 */
	public function editAction(Tx_T3dance_Domain_Model_eventProgram $eventProgram) {
		$this->view->assign('eventProgram', $eventProgram);
	}

	/**
	 * Updates an existing eventProgram and forwards to the index action afterwards.
	 *
	 * @param Tx_T3dance_Domain_Model_eventProgram $eventProgram The eventProgram to display
	 */
	public function updateAction(Tx_T3dance_Domain_Model_eventProgram $eventProgram) {
		$this->eventProgramRepository->update($eventProgram);
		$this->flashMessageContainer->add('Your eventProgram was updated.');
		$this->redirect('index');
	}

	/**
	 * Deletes an existing eventProgram
	 *
	 * @param Tx_T3dance_Domain_Model_eventProgram $eventProgram The eventProgram to be deleted
	 */
	public function deleteAction(Tx_T3dance_Domain_Model_eventProgram $eventProgram) {
		$this->eventProgramRepository->remove($eventProgram);
		$this->flashMessageContainer->add('Your eventProgram was removed.');
		$this->redirect('index');
	}
	

	
	/**
	 * list action
	 *
	 * @return string The rendered list action
	 */
	public function listAction() {
	}
	
	/**
	 * edit action
	 *
	 * @return string The rendered edit action
	 */
	public function editAction() {
	}
	
	/**
	 * create action
	 *
	 * @return string The rendered create action
	 */
	public function createAction() {
	}
	
}
?>